package com.lam.generator.listener;

import com.lam.common.components.easyexcel.imp.listener.BaseListener;
import com.lam.common.components.easyexcel.imp.model.ImportWrapper;
import com.lam.generator.entity.GenCodeModule;
import com.lam.generator.entity.imp.GenCodeModuleImp;
import com.lam.generator.service.GenCodeModuleService;

/**
 * 代码模块导入读取类 
 * 此类不能单例，要每次读取excel都要new 
 * @author admin
 *
 */
public class UploadGenCodeModuleListener extends BaseListener<GenCodeModuleImp, GenCodeModule> {
	
	private GenCodeModuleService genCodeModuleService;

	public UploadGenCodeModuleListener(GenCodeModuleService genCodeModuleService) {
		super(GenCodeModuleImp.class, GenCodeModule.class);
		this.genCodeModuleService = genCodeModuleService;
	}

	//重新该方法可自定义校验数据
//	@Override
//	protected String checkData(ImportEntry<GenCodeModuleImp, GenCodeModule> entry) {
//		//自定义校验数据逻辑
//		return null;
//	}

	@Override
	protected void saveSuccessData(ImportWrapper<GenCodeModuleImp, GenCodeModule> wrapper) {
		
		genCodeModuleService.importData(wrapper);
	}


}
